<template>
	<view class="top-three height-limit">
		<!-- 第二名 -->
		<view bindtap="toOtherPage" class="num second" data-url="1" hoverClass="none">

			<view class="top-image">
				<image class="avatar" :src="second.userInfo.avatarUrl || '/static/tabbar/about.png'"></image>
				<image class="rank-img" src="/static/integral/rank2.png"></image>
			</view>

			<view class="top-row">
				<image class="rank-two" src="/static/integral/number2.png"></image>
				<view class="top-line"></view>
				<view class="top-detail">
					<view class="list-name text-cut" style="max-width: 120rpx;">
						{{second.name ? second.name : second.userInfo.nickName }}
						<!-- {{second.name ? second.name : (second.userInfo.nickName.length>0&&second.userInfo.nickName.substring(0,4))}} -->
					</view>
					<view class="list-points">
						<view class="list-large">积分:{{second.integral || '0' }}</view>
						<!-- <view class="list-per">.23</view> -->
					</view>
				</view>
			</view>

			<view class="child-points">
				<view class="list-child field">
					<view class="child-sub">参与数: {{second.aJoin.length || '0' }}</view>
					<!-- {{second.aJoin.length || '' }} -->
				</view>
			</view>

		</view>

		<!-- 第一名 -->
		<view bindtap="toOtherPage" class="num first" data-url="gfhfgh" hoverClass="none">

			<view class="first-avatar">
				<image class="avatar" :src="first.userInfo.avatarUrl || '/static/tabbar/about.png'"></image>
				<image class="rank-img" src="/static/integral/rank1.png"></image>
			</view>

			<view class="top-row">
				<image class="top-rank" src="/static/integral/number1.png"></image>
				<view class="top-line"></view>
				<view class="top-detail">
					<view class="list-name text-cut" style="max-width: 120rpx;">
						<!-- {{first.name ? first.name : (first.userInfo.nickName.length>0&&first.userInfo.nickName.substring(0,4)) }}
		 -->
						{{first.name ? first.name : first.userInfo.nickName }}
					</view>
					<view class="list-points">
						<view class="list-large">积分:{{first.integral || '0' }}</view>
						<!-- <view class="list-per">.23</view> -->
					</view>
				</view>
			</view>

			<view class="child-points">
				<view class="list-child field">
					<view class="child-sub">参与数: {{first.aJoin.length || '0' }}</view>
					<!-- {{first.aJoin.length || '' }} -->
				</view>
			</view>

		</view>

		<!-- 第三名 -->
		<view bindtap="toOtherPage" class="num third" data-url="/i" hoverClass="none">

			<view class="top-image">
				<image class="avatar" :src="third.userInfo.avatarUrl || '/static/tabbar/about.png'"></image>
				<image class="rank-img" src="/static/integral/rank3.png"></image>
			</view>

			<view class="top-row">
				<image class="rank-three" src="/static/integral/number3.png"></image>
				<view class="top-line"></view>
				<view class="top-detail">
					<view class="list-name text-cut" style="max-width: 120rpx;">
						{{third.name ? third.name : third.userInfo.nickName }}
					</view>
					<view class="list-points">
						<view class="list-large">积分:{{third.integral || '0' }}</view>
						<!-- <view class="list-per">.23</view> -->
					</view>
				</view>
			</view>

			<view class="child-points">
				<view class="list-child field">
					<view class="child-sub">参与数: {{third.aJoin.length || '0' }}</view>
					
				</view>
			</view>

		</view>

	</view>
</template>

<script>
	export default {
		props: {
			first: {
				type: Object,
				required: true
			},
			second: {
				type: Object,
				required: true
			},
			third: {
				type: Object,
				required: true
			}
		}
	}
</script>

<style scoped>
	.top-three {
		color: #333;
		width: 100%;
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: flex-end;
		z-index: 100;
	}

	.top-three .num {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-end;
		position: relative;
	}

	/* 分割线 */
	.top-line {
		height: 70rpx;
		background-color: #eee;
		width: 2rpx;
		margin: 0 16rpx;
	}

	/* 1 */
	.first {
		width: 34%;
		background-color: #fff;
		height: 469rpx;
		background: rgba(255, 255, 255, 1);
		box-shadow: 0 -40rpx 18rpx 2rpx rgba(0, 0, 0, 0.06);
		border-top-left-radius: 10px;
		border-top-right-radius: 10px;
		z-index: 1;
	}

	/* 1的头像和奖牌 */
	.first-avatar {
		height: 140rpx;
		width: 140rpx;
		border-radius: 50%;
		margin-bottom: 20rpx;
		position: relative;
	}

	.first-avatar .avatar {
		height: 140rpx;
		width: 140rpx;
		border-radius: 50%;
	}

	.first-avatar .rank-img {
		height: 40rpx;
		width: 40rpx;
		border-radius: 50%;
		position: absolute;
		bottom: 0;
		right: 0;
	}

	/* 2&3 */
	.second,
	.third {
		width: 33%;
		height: 429rpx;
		background-color: #fff;
	}

	.second {
		border-top-left-radius: 10px;
	}

	.third {
		border-top-right-radius: 10px;
	}

	/* 2&3的头像（小一点）和奖牌 */
	.top-image {
		height: 120rpx;
		width: 120rpx;
		border-radius: 50%;
		margin-bottom: 20rpx;
		position: relative;
	}

	.top-image .avatar {
		height: 120rpx;
		width: 120rpx;
		border-radius: 50%;
	}

	.top-image .rank-img {
		height: 34rpx;
		width: 34rpx;
		border-radius: 50%;
		position: absolute;
		bottom: 0;
		right: 0;
	}

	/* 排名图片 */
	.top-rank {
		width: 28rpx;
		height: 79rpx;
	}

	.rank-two,
	.rank-three {
		width: 32rpx;
		height: 45rpx;
	}

	/* 名字和分数 */
	.top-detail {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.list-name {
		margin-bottom: 13rpx;
		font-size: 28rpx;
		font-family: 'PingFang-SC-Bold';
		font-weight: bold;
	}

	.list-points {
		display: flex;
		flex-direction: row;
		font-size: 24rpx !important;
		font-family: 'PingFang-SC-Bold';
		/* font-weight: bold; */
	}

	.list-large {
		line-height: 24rpx;
		font-size: 20rpx !important;
	}

	.list-per {
		margin-left: 8rpx;
		font-size: 24rpx;
	}

	/* 各项参数 */
	.child-points {
		margin-bottom: 30rpx;
		margin-top: 8rpx;
	}

	.list-child {
		width: 135rpx;
		margin-top: 13rpx;
		color: #999;
		font-size: 20rpx;
		line-height: 20rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}

	.top-row {
		max-height: 90rpx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
	}

	.height-limit .second,
	.height-limit .third {
		height: 300rpx;
	}

	.height-limit .first {
		height: 350rpx;
	}
</style>
